import request from '@/utils/request'

export function fetchCaptcha() {
  return request({
    url: '/captcha',
    method: 'post'
  })
}

export function loginByUsername(data) {
  return request({
    url: '/app/login',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post',
  })
}
export function token(data) {
  return request({
    url: '/token',
    method: 'post',
    data
  })
}
export function getUserInfo() {
  return request({
    url: '/user/info',
    method: 'post'
  })
}
export function getUserByToken(data) {
  return request({
    url: '/loginAuth/getUserByToken',
    method: 'post',
    data
  })
}